import { notFound } from "next/navigation"; import type { ReactNode } from "react"; import { getProject } from "./data"; /** * Existence gate for /projects/[slug]: resolves the project before this segment's loading boundary streams, * so an unknown slug is a real 404 (not a soft one). Other API failures fall through to the page. */ export default async function ProjectLayout({ children, params }: { children: ReactNode; params: Promise<{ slug: string }> }) { const { slug } = await params; const r = await getProject(slug); if (!r.ok && r.status === 404) notFound(); return <>{children}; }